<template>
  <div id="newsInfoPage">
    <div class="actionBar">
      <div>图文信息（共{{total}}条）</div>
      <div class="build">+新建</div>
    </div>
    <table class="table">
      <thead>
        <tr>
          <th>#</th>
          <th>图片</th>
          <th>标题</th>
          <th>点赞数目</th>
          <th>阅读数目</th>
          <th>显示时间</th>
          <th>留言</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item, index) in tableData">
          <td>{{index + 1}}</td>
          <td><img :src="item.clsIcon"/></td>
          <td>{{item.clsName}}</td>
          <td>{{item.showIndex}}</td>
          <td>{{item.indexLimit}}</td>
          <td style="font-size: 20px">
            <i class="el-icon-edit" @click="edit($event)"></i>
            <i class="el-icon-delete" @click="remove($event)"></i>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script>
  import axios from 'axios'
  export default{
    name: 'newsInfoPage',
    data () {
      return {
        tableData: [],
        total: 0
      }
    },
    beforeCreate () {

    },
    created () {
      // this.$store.commit('CHANGECLSID', this.$route.query.clsId)
      axios(125, 1)
    },
    methods: {
      axios (id, pageNum) {
        axios({
          headers: {'Content-Type': 'application/x-www-form-urlencoded'},
          url: this.$store.state.baseURI + 'oss/info/list',
          method: 'GET',
          params: {
            cls_id: id,
            page_num: pageNum,
            token: this.$store.state.token
          }
        }).then(obj => {})
      }
    }
  }
</script>
<style></style>
